package com.shop.entity;

// Generated 2015-10-7 22:59:34 by Hibernate Tools 4.0.0

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.OneToOne;
import javax.persistence.PrimaryKeyJoinColumn;
import javax.persistence.Table;
import org.hibernate.annotations.GenericGenerator;
import org.hibernate.annotations.Parameter;

/**
 * PictureRelate generated by hbm2java
 */
@Entity
@Table(name = "picture_relate", catalog = "shop")
public class PictureRelate implements java.io.Serializable {

	private Integer picId;
	private News news;
	private Pictures pictures;
	private ProdRefund prodRefund;
	private Shop shop;
	private Product product;
	private ProdCommt prodCommt;

	public PictureRelate() {
	}

	public PictureRelate(Pictures pictures) {
		this.pictures = pictures;
	}

	public PictureRelate(News news, Pictures pictures, ProdRefund prodRefund,
			Shop shop, Product product, ProdCommt prodCommt) {
		this.news = news;
		this.pictures = pictures;
		this.prodRefund = prodRefund;
		this.shop = shop;
		this.product = product;
		this.prodCommt = prodCommt;
	}

	@GenericGenerator(name = "generator", strategy = "foreign", parameters = @Parameter(name = "property", value = "pictures"))
	@Id
	@GeneratedValue(generator = "generator")
	@Column(name = "pic_id", unique = true, nullable = false)
	public Integer getPicId() {
		return this.picId;
	}

	public void setPicId(Integer picId) {
		this.picId = picId;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "new_id")
	public News getNews() {
		return this.news;
	}

	public void setNews(News news) {
		this.news = news;
	}

	@OneToOne(fetch = FetchType.LAZY)
	@PrimaryKeyJoinColumn
	public Pictures getPictures() {
		return this.pictures;
	}

	public void setPictures(Pictures pictures) {
		this.pictures = pictures;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "return_id")
	public ProdRefund getProdRefund() {
		return this.prodRefund;
	}

	public void setProdRefund(ProdRefund prodRefund) {
		this.prodRefund = prodRefund;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "shop_id")
	public Shop getShop() {
		return this.shop;
	}

	public void setShop(Shop shop) {
		this.shop = shop;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "prod_id")
	public Product getProduct() {
		return this.product;
	}

	public void setProduct(Product product) {
		this.product = product;
	}

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "commt_id")
	public ProdCommt getProdCommt() {
		return this.prodCommt;
	}

	public void setProdCommt(ProdCommt prodCommt) {
		this.prodCommt = prodCommt;
	}

}
